package com.gm.springboot.service.impl;

import com.github.pagehelper.PageHelper;
import com.gm.springboot.bean.Student;
import com.gm.springboot.mapper.StudentMapper;
import com.gm.springboot.service.StudentService;
import com.gm.springboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Administrator
 * @Date 2020/7/2 15:45
 **/
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    StudentMapper studentMapper;
    @Override
    public List<Student> findStudentAll(Integer page,Integer size) {
        PageHelper.startPage(page,size);
        return this.studentMapper.findStudentAll();
    }

    @Override
    public int addStudent(Student student) {
        return this.studentMapper.addStudent(student);
    }

    @Override
    public int delStudent(Integer sid) {
        return this.studentMapper.delStudent(sid);
    }

    @Override
    public Student findStudentById(Integer sid) {
        return this.studentMapper.findStudentById(sid);
    }

    @Override
    public int updStudent(Student student) {
        return this.studentMapper.updStudent(student);
    }
}
